package com.itheima.day03.neibulei2;

public class test {
    public static void swim(swimgame swim){
        System.out.println("start");
        swim.swim();
        System.out.println("end");


    }
    public static void main(String[] args) {
        swim(new swimgame() {
            @Override
            public void swim() {
                System.out.println("running");
            }
        });
        swimgame dog = new swimgame() {
            @Override
            public void swim() {
                System.out.println("dog swimming");
            }
        };
        swim(dog);
    }
}
